package com.spzx.product.api.fallback;

import com.spzx.common.core.domain.R;
import com.spzx.product.api.RemoteGetSkuPrice;
import com.spzx.product.api.domain.SkuPriceVo;
import org.springframework.cloud.openfeign.FallbackFactory;

/**
 * ClassName: RemoteGetSkuPriceFallbackFactory
 * Description:
 *
 * @Author linz
 * @Creat 2025/3/21 14:58
 * @Version 1.00
 */
public class RemoteGetSkuPriceFallbackFactory implements FallbackFactory<RemoteGetSkuPrice> {
    @Override
    public RemoteGetSkuPrice create(Throwable cause) {
        return new RemoteGetSkuPrice() {
            @Override
            public R<SkuPriceVo> getSkuPrice(Long skuId, String source) {
                cause.printStackTrace();
                return R.fail("获取商品价格失败->"+cause.getMessage());
            }
        };
    }
}
